from django.shortcuts import render
from django.template import loader
# Create your views here.
from django.http import HttpResponse

import os
import platform
def index(request):

    server = platform.system()
    uptime = os.popen("uptime /")
    info = uptime.read()
    file = os.popen("cat /sys/class/thermal/thermal_zone0/temp")
    cpuT = float(file.read()) / 1000
    #cpuT =1000
    context={
        'server':server,
        'info':info,
        'cupT':cpuT
    }
    return render(request,'theme01/index.html',context)